package services

import (
	"task_queue/internal/models"
	"task_queue/internal/utils"
)

type TaskService struct {
	EventBus *utils.EventBus
}

func (s *TaskService) UpdateTaskStatus(taskID string, newStatus models.TaskStatus) {

	// 发布任务状态变更事件
	s.EventBus.Publish(utils.Event{
		Type: "task_status_changed",
		Data: map[string]interface{}{
			"task_id": taskID,
			"status":  newStatus,
		},
	})
}
